<?php

namespace app\api\model;

use think\Model;

class ArticleList extends Model
{
    protected $autoWriteTimestamp = true;

    protected $pk = 'article_id';

    public static function getListByWhere($where, $order, $pageNo, $pageSize)
    {
        return self::where($where)
            ->order($order)
            ->page($pageNo, $pageSize)
            ->select()
            ->toArray();
    }

    public static function countListByWhere($where)
    {
        return self::where($where)->count();
    }

    public static function getArticleInfo($articleId)
    {
        return self::where('article_status', 1)->find($articleId);
    }
}